import { Router } from 'express';
import { authMiddleware } from '../middleware/auth';
import { NotificationController } from '../controllers/NotificationController';

const router: Router = Router();
const notificationController = new NotificationController();

// 需要认证的路由
router.use(authMiddleware);

// 获取通知列表
router.get('/', notificationController.getNotifications);

// 获取未读通知数量
router.get('/unread-count', notificationController.getUnreadCount);

// 标记单个通知为已读
router.put('/:id/read', notificationController.markAsRead);

// 标记所有通知为已读
router.put('/read-all', notificationController.markAllAsRead);

// 删除通知
router.delete('/:id', notificationController.deleteNotification);

export default router;